import java.util.*;

class ElementCreate {
	protected Element[] m_array;
	
	public Element[] createElement(int n) {
		m_array = new Element[n+1];
		
		for(int i=0; i<m_array.length; ++i) {
			Random ram = new Random();
			
			m_array[i] = new Element();
			m_array[i].setKey(ram.nextInt() % m_array.length * 10 + m_array.length * 10);
		}
		
		return m_array;
	}
}

public class Main {
	public static void testInsertionSort() {
		ElementCreate o = new ElementCreate();
		InsertionSort sort = new InsertionSort();
		sort.setData(o.createElement(12));
		sort.shellSort();
	}
	
	public static void testSwapSort() {
		ElementCreate o = new ElementCreate();
		SwapSort sort = new HoareQuickSort();
		sort.setData(o.createElement(8));
		sort.sort();
	}
	
	public static void main(String[] args) throws InterruptedException {
		//testInsertionSort();
		//testSwapSort();
		
		/*LinkedList<String> l = new LinkedList<String>();
		add(l);
		ListIterator<String> it = l.listIterator();
		while(it.hasNext()) {
			System.out.println(it.next());
		}*/
		
		Date d = getDate();
		System.out.println(d.hashCode());
		System.out.println( "d = " + d);
	}
	
	private static Date getDate() {
		Date d2 = new Date();
		StringBuffer now = new StringBuffer(d2.toString());
		System.out.println(d2.hashCode());
		System.out.println(now);
		return d2;
	}
	
	public static void add(LinkedList<String> l) {
		l.addLast("aa");
		l.addLast("bb");
		l.addLast("cc");
	}
	
	public static String cleanPhone(String in) {
		String str = in;
		str = str.replace("-", "");
		str = str.replace(" ", "");
		str = str.replace("+", "");
		if (str.length() > 11) {
			str = str.replaceAll("^86", "");
			str = str.replaceAll("^086", "");
		}	
		return str;
	}
}
